﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceModel;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace StockMatch.Host
{
    partial class ServiceCore : ServiceBase
    {
        private static ServiceHost service = null;

        public ServiceCore()
        {
            InitializeComponent();

            //MailReceiverStarter.IsConsole = false;
            //MailReceiverStarter.WriteErrorLog += Program.Worker_WriteLog;
        }

        protected override void OnStart(string[] args)
        {
            //MailAlert.Init();

            //Wcf.OpenServiceHost<IMailAlert, MailAlert>(2005, "IMailAlert");
        }

        protected override void OnStop()
        {
            if (service != null)
            {
                try
                {
                    service.Close();
                }
                catch { }
            }
        }
    }
}
